package com.bus.core.entity;

import com.bus.core.common.Comment;
import com.bus.core.common.CommonSuper;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * 字典表
 * -. 字典树 参数条件查询
 * -. 通过类型查询字典附带层级(可以级联)
 * -. 常见字典入库,批处理字典(excel,txt,properties等等)
 *
 * @author bom
 * @date 2021-12-31
 */
@Entity
@Table(name = "c_dic", uniqueConstraints = {
        @UniqueConstraint(columnNames = {"type", "value"})
})
@EqualsAndHashCode(callSuper = false)
@Data
@Comment("字典表")
public class DicEntity extends CommonSuper {
    @Id
    @Comment("id")
    private String id;
    /**
     * 父节点id
     */
    @Comment("上一级id")
    private String pid;
    /**
     * 身份证
     */
    @Comment("名称")
    private String name;
    /**
     * id-card
     */
    @Comment("值")
    private String value;
    /**
     * 别名,根据不同的策略显示 大陆居民证
     */
    @Comment("别名")
    private String alias;
}
